<%--
  Created by IntelliJ IDEA.
  User: hklyq
  Date: 2020-06-08
  Time: 13:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
    <title>发票详情的支付表&费用项</title>
</head>
<body>
<div id="invoiceBscGrid" class="sq-grid"></div>
</body>
<script>
    var grid;

    //初始化列表
    function initGrid() {

        $("#invoiceBscGrid").ligerGrid({
            usePager: false,
            url: "<%=path%>/invoice/prjbillfeer/initList.do?applyId=" + applyId,
            method: 'get',
            columns: [{
                display: '业务模式',
                name: 'bizTypCdNm',
                width: 180,
                align: 'center'
            }, {
                display: '支付表号',
                name: 'paySchNo',
                width: 200,
                align: 'center',
                render: function (rowdata, rowindex, value, column) {
                    var h = '';
                    h = '<a href="javascript:detailBtn(';
                    h += "'" + rowdata.id + "',";
                    h += "'" + rowdata.paySchId + "',";
                    h += ')">' + value + '</a>'
                    return h;
                },
            }, {
                display: '费用项',
                name: 'feeTypCdNm',
                width: 150,
                align: 'center'
            }, {
                display: '资金流向',
                name: 'capFlowNm',
                width: 100,
                align: 'center'
            }, {
                display: '应收金额(元)',
                name: 'billAmt',
                width: 120,
                align: 'right',
                render: function (rowdata, index, value) {
                    return '&yen;' + FormatMoney(rowdata.billAmt / 100);
                }
            }, {
                display: '实收金额(元)',
                name: 'billAmt',
                width: 120,
                align: 'right',
                render: function (rowdata, index, value) {
                    return '&yen;' + FormatMoney(rowdata.billAmt / 100);
                }
            }, {
                display: '开票类型',
                name: 'billTypCdNm',
                width: 150,
                align: 'center'
            }, {
                display: '票据状态',
                name: 'billStsCdNm',
                width: 150,
                align: 'center'
            },{
                display: '票据号',
                name: 'billNo',
                width: 160,
                align: 'left',
                editor: {type: 'text'}
            }, {
                display: '发票代码',
                name: 'invoiceCode',
                width: 100,
                align: 'center'
            }],
            onBeforeSubmitEdit: function (e) {//重新赋值,要不然选中后离开会把key显示在前端
                /* if (e.selected && e.column.columnname == "billTypCdNm") {
                    e.record.billTypCd = e.value;
                    e.value = e.selected[e.column.editor.textField];
                } */
            },
            isDisabledSelect: function (item) {
                /* if (StringUtils.isNotEmpty(item.billId)) {
                    return true;
                } */
            },
            width: '100%',
            //height:'100%',
            heightDiff: -2,
            root: 'rows',
            record: 'total',
            rownumbers: true,
            enabledEdit: false,
            checkbox: false,
            fixedCellHeight: false,
            usePagerOnLessPagesize: false,
            onAfterShowData: function (currentData) {
                SetIframe_height();
                $(".liger_tip").ligerTip();
            }
        });

        grid = liger.get("invoiceBscGrid");
        //grid.setHeight(100);
        grid.options.isSingleCheck = false;
    }

    // 查看支付表详情
    function detailBtn(id, paySchId) {
        var editFlag = true;
        Add_navTab('tab_prj_quat_prps' + id, '查看支付表', '<%=path%>/project/prjprdpayschm/toPrjPrdPaySchMDetailPageBySchId.do?paySchId=' + paySchId);
    }
</script>
</html>
